<h3>Lista nerazduženih porudzbina</h3>

<!--<button class="btn btn-success" ng-click="izmeniPorudzbinu('novi')" data-toggle="modal" href="#editModal">
    <i class="icon-calendar icon-white"></i>&nbsp;Kreiraj novu porudžbinu</button>-->
<table id="searchObjResults" class='table table-striped'>

    <thead>
    <tr>
        <th>Porudžbina</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
    </tr>
    </thead>
    <tbody>
    <tr style="height: 45px;">
		<td>
			<label ng-click="orderByField = 'datumPorudzbine'; reverseSort = !reverseSort">
				<b>Datum</b>
				<span ng-show="orderByField == 'datumPorudzbine'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td>
			<label ng-click="orderByField = 'razduzeno'; reverseSort = !reverseSort">
				<b>Razduženo</b>
				<span ng-show="orderByField == 'razduzeno'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td>
			<label ng-click="orderByField = 'napravljena'; reverseSort = !reverseSort">
				<b>Napravljena</b>
				<span ng-show="orderByField == 'napravljena'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td>
			<label ng-click="orderByField = 'ime'; reverseSort = !reverseSort">
				<b>Konobar</b>
				<span ng-show="orderByField == 'ime'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td>
			<label ng-click="orderByField = 'stoID'; reverseSort = !reverseSort">
				<b>Sto</b>
				<span ng-show="orderByField == 'stoID'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td></td>
	</tr>
    <tr ng-repeat='porudzbina in porudzbine | filter:search:strict | orderBy:orderByField:reverseSort' onload="JavaScript:timedRefresh(500);">
        <td>{{porudzbina.datumPorudzbine}}</td>
        <td>{{porudzbina.razduzeno}}</td>
        <td>{{porudzbina.napravljena}}</td>
        <td>{{porudzbina.ime}} {{porudzbina.prezime}}</td>
        <td>{{porudzbina.stoID}}</td>
        <td><div ng-controller="PorudzbinaListCtrl">
            <button role='button' class='btn btn-danger' ng-click="porudzbina.razduzeno = 1; razduzi(porudzbina);" >
                <span class="glyphicon glyphicon-usd"></span>&nbsp;Razduži
            </button></div>
        </td>
    </tr>
    </tbody>
</table>
<div class="modal fade"  tabindex="-1" role="dialog" ng-include="'view/porudzbina-detalji.html'" id="editModal" aria-hidden="true"></div>
</div>